package com.meixiang.entity.coupon;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

/**
 * Created by Administrator on 2016/5/24.
 */
public class CouponResultEntity implements Parcelable{

    private int pageNo ; // 当前页数
    private int totalPage ; // 总页数
    private int pageSize ; //页面显示数
    private List<CouponEntity> couponList ; //优惠券实体类


    public void setPageNo(int pageNo) {
        this.pageNo = pageNo;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public int getPageNo() {
        return pageNo;
    }

    public int getPageSize() {
        return pageSize;
    }

    public List<CouponEntity> getCouponList() {
        return couponList;
    }

    public void setCouponList(List<CouponEntity> couponList) {
        this.couponList = couponList;
    }

    public CouponResultEntity() {
    }

    @Override
    public String toString() {
        return "CouponResultEntity{" +
                "pageNo=" + pageNo +
                ", totalPage=" + totalPage +
                ", pageSize=" + pageSize +
                ", couponList=" + couponList +
                '}';
    }

    public int getTotalPage() {
        return totalPage;
    }

    public void setTotalPage(int totalPage) {
        this.totalPage = totalPage;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.pageNo);
        dest.writeInt(this.totalPage);
        dest.writeInt(this.pageSize);
        dest.writeTypedList(couponList);
    }

    protected CouponResultEntity(Parcel in) {
        this.pageNo = in.readInt();
        this.totalPage = in.readInt();
        this.pageSize = in.readInt();
        this.couponList = in.createTypedArrayList(CouponEntity.CREATOR);
    }

    public static final Creator<CouponResultEntity> CREATOR = new Creator<CouponResultEntity>() {
        @Override
        public CouponResultEntity createFromParcel(Parcel source) {
            return new CouponResultEntity(source);
        }

        @Override
        public CouponResultEntity[] newArray(int size) {
            return new CouponResultEntity[size];
        }
    };
}
